<template>
	<div class="page">
		<!-- 面包屑导航 -->
		<el-breadcrumb separator-class="el-icon-arrow-right" style="padding: 30px;">
			<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
			<el-breadcrumb-item>商户管理</el-breadcrumb-item>
			<el-breadcrumb-item>商户列表(超级管理)</el-breadcrumb-item>
			<el-breadcrumb-item>瑞银信进件</el-breadcrumb-item>
		</el-breadcrumb>
		<el-steps :active="$store.state.active" finish-status="success" align-center>
			<el-step title="上传图片"></el-step>
			<el-step title="完善商户信息"></el-step>
			<el-step title="返回结果"></el-step>
		</el-steps>
		<!-- 图片上传区域 -->
		<div v-show="$store.state.showImg">
			<upImg :userID="imgData"></upImg>
			<div class="next-up-img">
				<el-button type="primary" @click="nextImg">下一步</el-button>
			</div>
		</div>
		<!-- 商户资料 -->
		<div v-show="$store.state.showInfo">
			<info :userID="userid"></info>
		</div>
	</div>
</template>

<script>
	import upImg from "./ryx-tem/up-1";
	import info from "./ryx-tem/info";
	export default {
		components: {
			upImg,
			info
		},
		data() {
			return {
				userid: this.$route.query.id ? this.$route.query.id : 0,
				imgData:{}
			};
		},
		methods: {
			nextImg() {
				this.$store.commit('activeType',2);
				this.$store.commit('imgType',false);
				this.$store.commit('infoType',true);
			},
			onSubmit() {
				console.log('submit!');
			},
			getData(){
				let that = this;
				this.$axios({
					url: '/admin/general/getUserInfo',
					data: {
						userID: this.userid
					},
					success(res) {
						if (res.data.code == 200) {
							that.imgData = res.data.content;
							that.$store.commit('merchant', JSON.stringify(res.data.content));
						}
					}
				});
			}
		},
		created() {
			this.getData();
		}

	}
</script>
<style scoped>
	.page {
		background: #FFFFFF;
	}

	.next-up-img {
		text-align: center;
		margin-top: 50px;
	}
</style>
